package com.xianggu.demo.pattern.strategy;

import java.io.File;
import java.io.IOException;
import java.net.URL;

class FileBReaderStrategy implements FileReaderStrategy {
    @Override
    public String readFile() throws IOException {
        URL resource = super.getClass().getClassLoader().getResource("b.txt");
        File file = new File(resource.getFile());
        if (file.exists()) {
            return "Read from file b";
        }
        return null;
    }
}